#pragma once
#include "Region.h"
#include "opencv.hpp"




void erosion_rectangle1(const HRegion& src, HRegion& dst, int width, int height);
void dilation_rectangle1(const HRegion& src, HRegion& dst, int width, int height);
void opening_rectangle1(const HRegion& src, HRegion& dst, int width, int height);
void closing_rectangle1(const HRegion& src, HRegion& dst, int width, int height);

void erosion_circle(const HRegion& src, HRegion& dst, double Radius);
void dilation_circle(const HRegion& src, HRegion& dst, double Radius);
void opening_circle(const HRegion& src, HRegion& dst, double Radius);
void closing_circle(const HRegion& src, HRegion& dst, double Radius);

void gen_circle(HRegion& Circle, double Row, double Column, double Radius);
void gen_rectangle1(HRegion& Rectangle, double Row1, double Column1, double Row2, double Column2);

void intersection1(const ListHRegion& rle, HRegion& dst);
void intersection2(const HRegion& rle, const HRegion& Region, HRegion& dst);
void union1(const ListHRegion& rle, HRegion& dst);
void union2(const HRegion& rle, const HRegion& Region, HRegion& dst);
void difference(const HRegion& rle, const HRegion& Region, HRegion& dst);

void concat_obj(const HRegion& rle, const HRegion& Region, ListHRegion& dst);
void connection(const HRegion& Region, HRegion& ConnectedRegions);
void select_obj(const HRegion& Region, HRegion& SelectedRegions, int Region_ID);
void select_shape(const HRegion& Region, HRegion& SelectedRegions, CondParam& m_CondParam);
void area_center(HRegion& Region, int& Area, float& Row, float& Column);
void select_shape_max_std(const HRegion& Region, HRegion& SelectedRegions);

void thresholdRLE(const cv::Mat& Image, HRegion& Region, double MinGray, double MaxGray);